package com.wyh.controller.groupOne.customer;

import com.wyh.common.result.Result;
import com.wyh.domain.vo.groupOne.customer.ResourceVO;
import com.wyh.service.groupOne.customer.MasterDataCResourceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "客户-资源管理API" )
@RestController
@RequestMapping("/cresource")
public class CResourceController {

    @Autowired
    private MasterDataCResourceService resourceService;


    @ApiOperation("客户详情-资源信息" )
    @GetMapping("selectAll/{id}")
    @ApiImplicitParam(name = "id" , value = "客户id" , required = true)
    public Result selectAll(@PathVariable Integer id) throws Exception {
        List<ResourceVO> resourceVOS = resourceService.selectByCustomerId(id);
        return Result.success(resourceVOS);
    }
}
